The File I/O API > The file I/O API > DWfile.exists()

 

DWfile.exists()

Availability

Dreamweaver 2.0

Description

Tests for the existence of the specified file.

Arguments

fileURL

The argument is the file you are looking for, expressed as a file:// URL.

Returns

true if the file exists, false otherwise.

Example

The following code checks for a file called mydata.txt and displays an alert box that tells the user whether the file exists.

var fileURL = "file:///c|/temp/mydata.txt";
if (DWfile.exists(fileURL)){
	alert( fileURL + " exists!");
}else{
	alert( fileURL + " does not exist.");
}